//
//  SRSportShareContentView.m
//  SportRing
//
//  Created by icelee on 14-10-29.
//  Copyright (c) 2014年 HotOne. All rights reserved.
//

#import "SRSportShareContentForDayView.h"
#import "SRMe+Cate.h"
#define TEXT_SIZE1 18
#define TEXT_SIZE2 11

#define TEXT_COLOR1 [UIColor red:231 green:99 blue:40 alpha:1.0]
#define TEXT_COLOR2 [UIColor red:59 green:164 blue:250 alpha:1.0]

@implementation SRSportShareContentForDayViewModel



@end


@interface SRSportShareContentForDayView()

@property (nonatomic, weak)IBOutlet UILabel *stepsLabel;
@property (nonatomic, weak)IBOutlet UILabel *distanceLabel;
@property (nonatomic, weak)IBOutlet UILabel *kalorieLabel;
@property (nonatomic, weak)IBOutlet UILabel *encourageLabel;
@property (nonatomic, weak)IBOutlet UILabel *planLabel;
@property (nonatomic, weak)IBOutlet UIImageView *peopleImageView;
@property (nonatomic, weak)IBOutlet UIImageView *completedImageView;
@property (nonatomic, weak)IBOutlet UILabel *notCompletedLabel;


@end

@implementation SRSportShareContentForDayView

- (void)awakeFromNib
{
    [super awakeFromNib];
    self.planLabel.hidden = YES;
    _completedImageView.hidden = YES;

}


- (void)setSRSportShareContentForDayViewData:(SRSportShareContentForDayViewModel *)model
{
    NSAttributedString *steps = [SRHelper attString:[NSString stringWithFormat:@"%d步",model.steps]
                                                      fromString:[[NSMutableArray alloc] initWithObjects:@"", nil]
                                                        toString:[[NSMutableArray alloc] initWithObjects:@"步", nil]
                                                        fontSize:[[NSMutableArray alloc] initWithObjects:[UIFont systemFontOfSize:TEXT_SIZE1], nil]
                                                           color:[[NSMutableArray alloc] initWithObjects:TEXT_COLOR1, nil]];
    self.stepsLabel.attributedText = steps;

    NSAttributedString *distance = [SRHelper attString:[NSString stringWithFormat:@"步行%.1f公里",model.distance]
                                         fromString:[[NSMutableArray alloc] initWithObjects:@"步行", nil]
                                           toString:[[NSMutableArray alloc] initWithObjects:@"公里", nil]
                                           fontSize:[[NSMutableArray alloc] initWithObjects:[UIFont systemFontOfSize:TEXT_SIZE2], nil]
                                              color:[[NSMutableArray alloc] initWithObjects:TEXT_COLOR2, nil]];
    self.distanceLabel.attributedText = distance;
    
    
    NSAttributedString *kalorie = [SRHelper attString:[NSString stringWithFormat:@"%d卡路里",(int)model.kalorie]
                                         fromString:[[NSMutableArray alloc] initWithObjects:@"", nil]
                                           toString:[[NSMutableArray alloc] initWithObjects:@"卡路里", nil]
                                           fontSize:[[NSMutableArray alloc] initWithObjects:[UIFont systemFontOfSize:TEXT_SIZE1], nil]
                                              color:[[NSMutableArray alloc] initWithObjects:TEXT_COLOR1, nil]];
    self.kalorieLabel.attributedText = kalorie;
    
    self.encourageLabel.text = [NSString stringWithFormat:@"消耗了%.1f个鸡腿",model.encourage];
    
    if (model.completeTask)
    {
        [_notCompletedLabel setText:@"任务已完成"];
    }
    else
    {
        [_notCompletedLabel setText:@"任务未完成"];
    }
    
    
    if ([[SRMe currentUser].gender integerValue] == SRGenderMale)
    {
        self.peopleImageView.image = [UIImage imageNamed:@"share_male"];

    }
    else
    {
        self.peopleImageView.image = [UIImage imageNamed:@"share_girl"];
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
